module.exports = async function (ctx, next) {
  const token = ctx.cookies.get('token')
  console.log(ctx.session[token])

  if (!ctx.session[token]) {
    // if (token != `admin_${new Date().getDate()}`) {
    ctx.response.status = 500
    ctx.body = {
      code: 401,
      message: '用户未登录'
    }
  } else {
    await next()
  }
}